<template>
  <div class="header">
    <div class="logo">
      <img src="@/assets/img/logo.png" alt="" />
      <span>电商后台管理系统</span>
      <el-button type="info" class="logout" @click="logout">退出</el-button>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    logout() {
      
      window.sessionStorage.removeItem('token')
      this.$router.push('/login')
    },
  },
}
</script>

<style scoped lang = 'less'>
.logo {
  height: 60px;
  background-color: #373d41;
  display: flex;
  align-items: center;

  span {
    color: #fff;
    font-size: 20px;
    margin-left: 10px;
  }
  .logout {
    margin: 0 15px 0 auto;
  }
}
</style>